package com.my.screenadapter.hook;

import android.util.Log;
import android.view.View;
import android.widget.Toast;

/**
 * Created by ${张英杰} on 2019/2/28.
 * 代理 OnClickListener
 */
class HookedClickListenerProxy implements View.OnClickListener{

    private View.OnClickListener originOnClickListener;

    public HookedClickListenerProxy(View.OnClickListener originOnClickListener) {
        this.originOnClickListener = originOnClickListener;
    }

    @Override
    public void onClick(View v) {
        Log.i(this.getClass().getSimpleName(), "onClick: ---- hook");
        Toast.makeText(v.getContext(),"Hook Click Listener",Toast.LENGTH_SHORT).show();
        if (originOnClickListener!=null){
            originOnClickListener.onClick(v);
        }
    }
}
